package com.letian.info.service.impl;

import java.util.List;
import com.letian.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.letian.info.mapper.InfoUserCollectMapper;
import com.letian.info.domain.InfoUserCollect;
import com.letian.info.service.IInfoUserCollectService;

/**
 * 用户收藏Service业务层处理
 * 
 * @author bmz
 * @date 2023-12-01
 */
@Service
public class InfoUserCollectServiceImpl implements IInfoUserCollectService 
{
    @Autowired
    private InfoUserCollectMapper infoUserCollectMapper;

    /**
     * 查询用户收藏
     * 
     * @param userCollectId 用户收藏主键
     * @return 用户收藏
     */
    @Override
    public InfoUserCollect selectInfoUserCollectByUserCollectId(Long userCollectId)
    {
        return infoUserCollectMapper.selectInfoUserCollectByUserCollectId(userCollectId);
    }

    /**
     * 查询用户收藏列表
     * 
     * @param infoUserCollect 用户收藏
     * @return 用户收藏
     */
    @Override
    public List<InfoUserCollect> selectInfoUserCollectList(InfoUserCollect infoUserCollect)
    {
        return infoUserCollectMapper.selectInfoUserCollectList(infoUserCollect);
    }

    /**
     * 新增用户收藏
     * 
     * @param infoUserCollect 用户收藏
     * @return 结果
     */
    @Override
    public int insertInfoUserCollect(InfoUserCollect infoUserCollect)
    {
        infoUserCollect.setCreateTime(DateUtils.getNowDate());
        return infoUserCollectMapper.insertInfoUserCollect(infoUserCollect);
    }

    /**
     * 修改用户收藏
     * 
     * @param infoUserCollect 用户收藏
     * @return 结果
     */
    @Override
    public int updateInfoUserCollect(InfoUserCollect infoUserCollect)
    {
        return infoUserCollectMapper.updateInfoUserCollect(infoUserCollect);
    }

    /**
     * 批量删除用户收藏
     * 
     * @param userCollectIds 需要删除的用户收藏主键
     * @return 结果
     */
    @Override
    public int deleteInfoUserCollectByUserCollectIds(Long[] userCollectIds)
    {
        return infoUserCollectMapper.deleteInfoUserCollectByUserCollectIds(userCollectIds);
    }

    /**
     * 删除用户收藏信息
     * 
     * @param userCollectId 用户收藏主键
     * @return 结果
     */
    @Override
    public int deleteInfoUserCollectByUserCollectId(Long userCollectId)
    {
        return infoUserCollectMapper.deleteInfoUserCollectByUserCollectId(userCollectId);
    }
}
